﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace huaguwang.virtualWeb.uc.index
{
    public partial class _paihang : System.Web.UI.UserControl
    {
        public enum eType
        {
            book = 0,
            expert = 1,
            formula = 2,
            soft = 3,
            talk = 4,
            video = 5,
            knowledge = 6
        }
        public eType _Type { get; set; }
        public string _TypeName { get; set; }
        protected string _url = "";
        private readonly D_T_EBook_Exp _D_Book = new D_T_EBook_Exp();
        private readonly D_T_Video_Exp _D_Video = new D_T_Video_Exp();
        private readonly D_T_SoftWare_Exp _D_Soft = new D_T_SoftWare_Exp();
        protected void Page_Load(object sender, EventArgs e)
        {
            IEnumerable<M_Page> item = null;
            switch(_Type)
            {
                case eType.book:
                    item = _D_Book.GetHotTop10(22, 6, 0, "/book/book{0}.html", "/book/bookclass{0}.html", "", 10, D_T_EBook_Exp.OrderByType.hot);
                    _url = "/book/index.html";
                    break;
                case eType.expert:
                    break;
                case eType.formula:
                    break;
                case eType.soft:
                    item = _D_Soft.GetHotTop10(22, 6, 0, "/soft/soft{0}.html", "/soft/softclass{0}.html", "", 10, D_T_SoftWare_Exp.OrderByType.hot);
                    _url = "/soft/index.html";
                    break;
                case eType.talk:
                    break;
                case eType.video:
                    item = _D_Video.GetHotTop10(22, 6, 0, "/video/video{0}.html", "/video/videoclass{0}.html", "", 10, D_T_Video_Exp.OrderByType.hot);
                    _url = "/video/index.html";
                    break;
                case eType.knowledge:
                    break;
                default:
                    break;
            }
            this.RepeaterExp1.DataSource = item;
            this.RepeaterExp1.DataBind();

        }
    }
}